function sort(arr) {
    arr.sort((a, b) => {
        return a - b;
    })
    return arr;
}
function Qsort(arr, start, end) {
    if (start == undefined || start == null) {
        start = 0;
        end = arr.length;
    }
    if (end - start > 1) {
        let s = start, e = end - 1;
        while (s != e) {
            if (s < e) {
                if (arr[s] > arr[e]) {
                    let t = arr[s];
                    arr[s] = arr[e];
                    arr[e] = t;
                    t = s;
                    s = e;
                    e = t;
                }
                s++;
            }
            if (s > e) {
                if (arr[s] < arr[e]) {
                    let t = arr[s];
                    arr[s] = arr[e];
                    arr[e] = t;
                    t = s;
                    s = e;
                    e = t;
                }
                s--;
            }
        }
        Qsort(arr, start, s);
        Qsort(arr, s + 1, end);
    }
    return arr;
}
function JSQsort(arr) {
    if (arr.length > 1) {
        let key = arr.pop();
        let leftArr = [];
        let rightArr = [];
        for (let i in arr) {
            if (arr[i] > key) {
                rightArr.push(arr[i]);
            } else {
                leftArr.push(arr[i]);
            }
        }
        leftArr = JSQsort(leftArr);
        leftArr.push(key);
        rightArr = JSQsort(rightArr);
        return leftArr.concat(rightArr);
    } else {
        return arr;
    }
}
function clone(arr) {
    return [].concat(arr);
}
function getRandomArray(length) {
    if (length == undefined || length == null) {
        length = 10;
    }
    let arr = [];
    for (let i = 0; i < length; i++) {
        arr.push(Math.round(Math.random() * length));
    }
    return arr;
}
